/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Mély
 */
@Embeddable
public class GroupePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "groupeid")
    private String groupeid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "userid")
    private String userid;

    public GroupePK() {
    }

    public GroupePK(String groupeid, String userid) {
        this.groupeid = groupeid;
        this.userid = userid;
    }

    public String getGroupeid() {
        return groupeid;
    }

    public void setGroupeid(String groupeid) {
        this.groupeid = groupeid;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (groupeid != null ? groupeid.hashCode() : 0);
        hash += (userid != null ? userid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GroupePK)) {
            return false;
        }
        GroupePK other = (GroupePK) object;
        if ((this.groupeid == null && other.groupeid != null) || (this.groupeid != null && !this.groupeid.equals(other.groupeid))) {
            return false;
        }
        if ((this.userid == null && other.userid != null) || (this.userid != null && !this.userid.equals(other.userid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.GroupePK[ groupeid=" + groupeid + ", userid=" + userid + " ]";
    }
    
}
